<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        var arr = [10,20,30,40,50,30];
        //判断数组中是否存在30
        console.log(arr.indexOf(60));
        console.log(arr.indexOf(30));
        console.log(arr.indexOf(30,4));
        if(arr.indexOf(30) > -1){
            console.log("存在");   
        }else{
            console.log("不存在");
        }
        



    </script>
</body>
</html>